import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/login",
      name: "login",
      component: () => import("../views/login/index.vue"),
    },
    {
      path: "/register",
      name: "register",
      component: () => import("../views/register/index.vue"),
    },
    {
      path: "/",
      name: "home",
      component: () => import("../views/home/index.vue"),
      children: [
        {
          path: "films",
          name: "films",
          component: () => import("../views/home-films/index.vue"),
          children: [
            {
              path: "now-playing",
              name: "now-playing",
              component: () =>
                import("../views/home-films-now-playing/index.vue"),
            },
            {
              path: "coming-soon",
              name: "coming-soon",
              component: () =>
                import("../views/home-films-coming-soon/index.vue"),
            },
          ],
        },
        {
          path: "cinemas",
          name: "cinemas",
          component: () => import("../views/home-cinemas/index.vue"),
        },
        {
          path: "zixun",
          name: "zixun",
          component: () => import("../views/home-zixun/index.vue"),
        },
        {
          path: "center",
          name: "center",
          component: () => import("../views/home-center/index.vue"),
        },
      ],
    },
  ],
});

export default router;
